package com.ali8ba.dao;

import java.io.Serializable;

public class EntityNotFoundException extends Exception {
	 private static final long serialVersionUID = 2867947966331594724L;
	  private final Serializable entityId;
	  private final String message;

	  public EntityNotFoundException(Class<?> entityClass, Serializable entityId)
	  {
	    this(entityClass, entityId, null);
	  }

	  public EntityNotFoundException(Class<?> entityClass, Serializable entityId, Throwable cause) {
	    this.message = "Instance of " + entityClass.getName() + " with primary key " + entityId + " cannot be found";
	    this.entityId = entityId;
	  }

	  public Serializable getEntityId() {
	    return this.entityId;
	  }

	  public String toString()
	  {
	    return this.message;
	  }
}
